package com.changgou.goods.feign;

import com.changgou.goods.pojo.Spu;
import com.changgou.util.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author tang.qingbo
 * @Date 2020/8/30 23:47
 * @Version 1.0
 */
@FeignClient(name = "goods")
@RequestMapping("/spu")
public interface SpuFeign {
    /**
     * 根据spuId获取spu数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Spu> findById(@PathVariable String id);

    /***
     * 查询Spu全部数据
     * @return
     */
    @GetMapping
    Result<List<Spu>> findAll();
}
